<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>register page</title>
    <style>
        table{border-collapse:collapse;border-spacing:0;border-left:1px solid #888;border-top:1px solid #888;margin: auto}
        th,td{border-right:1px solid #888;border-bottom:1px solid #888;padding:5px 15px;}
        th{font-weight:bold;}
        body{text-align: center}
    </style>
    {% load static %}
    <script type='text/javascript' src="/static/js/jquery.min.js"></script>
    <script type='text/javascript' src="/static/js/user.js"></script>
    <script type="text/javascript">
        $(document).ready(function(){
            $("#register").click(function(){
                var sn  = $("#showName").val();
                var pw1 = $("#password1").val();
                var pw2 = $("#password2").val();
                var un  = $("#userName").val();
                if(sn=='' || pw1=='' || pw2=='' || un==''){
                    alert('请填写完整信息');
                    return false;
                }
                if(pw1 != pw2){
                    alert('两次密码不同');
                    return false;
                }
                $("#dataForm").submit();
            });
        });
    </script>
</head>
<body>
<div style="width: 80%;height:40px;background-color: aqua;margin: 0 auto ">
    <div style="float:left;margin-left: 10px;margin-top: 10px"><a href="#" name="projectManager">项目管理&nbsp;&nbsp;</a>|</div>
    <div style="float:left;margin-left: 10px;margin-top: 10px"><a href="#" name="testCaseManager">测试用例管理&nbsp;&nbsp;</a>|</div>
    <div style="float:left;margin-left: 10px;margin-top: 10px"><a href="#" name="bugCheck">bug情况查看&nbsp;&nbsp;</a>|</div>
    <div style="float:left;margin-left: 10px;margin-top: 10px"><a href="#" name="registerPage">注册新用户</a></div>
    <div style="float:right;margin-right:10px;margin-top: 10px"><a href="#" name="logout">退出</a></div>
    <div style="float:right;margin-right:10px;margin-top: 10px">登录人：{{ request.session.showName }}&nbsp;&nbsp;</div>
    <form method="post" name="dataForm">
        {% csrf_token %}
        <input type="hidden" name="dataInput" />
    </form>
</div><p></p>
    <form name="dataForm" id="dataForm" action="/register/" method="post">
        {% csrf_token %}
        <table>
            <tr>
                <td>显示名字:</td>
                <td><input id="showName" name="showName"><font color="red">*</font></td>
            </tr>
            <tr>
                <td>用户名:</td>
                <td><input id="userName" name="userName"><font color="red">*</font></td>
            </tr>
            <tr>
                <td>密&nbsp;&nbsp;&nbsp;码:</td>
                <td><input id="password1" name="password1" type="password"><font color="red">*</font></td>
            </tr>
            <tr>
                <td>确认密码:</td>
                <td><input id="password2" name="password2" type="password"><font color="red">*</font></td>
            </tr>
            <tr>
                <td colspan="2" align="center">
                    <button name="register" id="register">注册</button>
                </td>
            </tr>
        </table>
    </form>
</body>
</html>